//package com.lac.component.aop;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.http.HttpStatus;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.ResponseStatus;
//import org.springframework.web.bind.annotation.RestControllerAdvice;
//
///**
// * @author xiaokuixiao
// * date2025/7/8 11:12
// */
//// 5.  全局异常处理 (可选，但强烈推荐)
//@RestControllerAdvice
//@Slf4j
//public class GlobalExceptionHandler {
//
//    @ExceptionHandler(InsufficientPermissionException.class)
//    @ResponseStatus(HttpStatus.FORBIDDEN)  // 403 Forbidden
//    public String handleInsufficientPermissionException(InsufficientPermissionException ex) {
//        log.error("权限错误：", ex);
//        return ex.getMessage(); // 或返回包含错误信息的 JSON
//    }
//}
